#ifndef Tagger_h
#define Tagger_h

#include "Sound.h"
#include "IRcommunication.h"

/*
NOTES:
 It's important to note that a PLAYER _has_ a TAGGER not the other way arround.
 A tagger should not know anything about it's player.
 */

class Tagger :  
public IRcommunication {

public:
  void begin(uint8_t pinEmmiter,uint8_t pinReceiver, uint8_t pinMuzzleLed, Sound & sound);
  uint8_t nAmmo;
  uint8_t damage;
  uint8_t clipSize; //n of ammo of a full clip
  unsigned int fireDelay; //in millis 
  uint8_t reloadDelay; //in seconds
  uint8_t nClips; //# of clips still available
  uint8_t startingClips; //# of clips available at the start of the game
  unsigned long endShootMoment;
  
  uint8_t muzzleLed;
  Sound *sound;

  void receive();
  boolean isHit(unsigned int message);
  void startShoot(uint8_t team, uint8_t playerNumber);
  void endShoot();
  void refreshStatus();
};


#endif

